<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="/layouts/default.xhtml">
    <ui:define name="title">#{text['paiementList.title']}</ui:define>
    <ui:param name="menu" value="PaiementMenu"/>
    <ui:define name="bodyId">paiementList</ui:define>

    <ui:define name="body">
        <div class="col-sm-10">
            <h2>#{text['paiementList.heading']}</h2>

            <h:form id="searchForm" styleClass="form-inline">
            <div id="search" class="text-right">
                <span class="col-sm-9">
                    <h:inputText id="q" name="q" size="20" value="#{paiementController.query}" styleClass="form-control input-sm"/>
                </span>
                <h:commandButton value="#{text['button.search']}" styleClass="btn btn-default btn-sm" action="#{paiementController.search}"/>
            </div>
            </h:form>

            <p>#{text['paiementList.message']}</p>

            <h:form id="editPaiement">

            <div id="actions" class="btn-group">
                <h:commandButton value="#{text['button.add']}" action="add" id="add" immediate="true" styleClass="btn btn-primary"/>
                <h:commandButton value="#{text['button.done']}" action="home" id="cancel" immediate="true" styleClass="btn btn-default"/>
            </div>

            <p:dataTable id="paiements" var="paiement" value="#{paiementController.paiements}"
                         sortBy="#{paiementController.sortColumn}" paginator="true" rows="25"
                         paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15">
                <p:column>
                    <f:facet name="header">
                        <p:column sortBy="id">
                            <h:outputText value="#{text['paiement.id']}" />
                        </p:column>
                    </f:facet>
                    <h:commandLink action="#{paiementController.edit}" value="#{paiement.id}">
                        <f:param name="id" value="#{paiement.id}"/>
                        <f:param name="from" value="list"/>
                    </h:commandLink>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <p:column sortBy="datePaiement">
                            <h:outputText value="#{text['paiement.datePaiement']}" />
                        </p:column>
                    </f:facet>
    <h:outputText value="#{paiement.datePaiement}" escape="true"/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <p:column sortBy="description">
                            <h:outputText value="#{text['paiement.description']}" />
                        </p:column>
                    </f:facet>
    <h:outputText value="#{paiement.description}" escape="true"/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <p:column sortBy="eleve">
                            <h:outputText value="#{text['paiement.eleve']}" />
                        </p:column>
                    </f:facet>
                    <h:outputText value="#{paiement.eleve.fullName}" escape="true"/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <p:column sortBy="montantPaye">
                            <h:outputText value="#{text['paiement.montantPaye']}" />
                        </p:column>
                    </f:facet>
    <h:outputText value="#{paiement.montantPaye}" escape="true"/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <p:column sortBy="numeroCheque">
                            <h:outputText value="#{text['paiement.numeroCheque']}" />
                        </p:column>
                    </f:facet>
    <h:outputText value="#{paiement.numeroCheque}" escape="true"/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <p:column sortBy="typePaiement">
                            <h:outputText value="#{text['paiement.typePaiement']}" />
                        </p:column>
                    </f:facet>
    <h:outputText value="#{paiement.typePaiement}" escape="true"/>
                </p:column>
            </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>
</html> 